﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_JH_YUBIANZJHPZ实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_JH_YUBIANZJHPZ
    {
        private decimal? m_dec_i_beiyong3;

        private decimal? m_dec_i_beiyong4;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_y;

        private decimal? m_dec_i_yucen;

        private decimal? m_dec_i_yucey;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuosj;

        private string m_str_s_banshicfn;

        private string m_str_s_banshicqdfn;

        private string m_str_s_banshicxx;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_benbufn;

        private string m_str_s_benbuqdfn;

        private string m_str_s_benbuxx;

        private string m_str_s_bennianq;

        private string m_str_s_caozuor;

        private string m_str_s_chaojihtjd;

        private string m_str_s_chaojihtjg;

        private string m_str_s_chaojihtjsx;

        private string m_str_s_chaojihtjz;

        private string m_str_s_chaoyonglsx;

        private string m_str_s_chaoyongltj;

        private string m_str_s_chaoyonglys;

        private string m_str_s_chaoyonglyz;

        private string m_str_s_dagnqianbz;

        private string m_str_s_fuliwcl;

        private string m_str_s_fuliwclxx;

        private string m_str_s_jiajiabl;

        private string m_str_s_jinnianq;

        private string m_str_s_qiannianq;

        private string m_str_s_qunianq;

        private string m_str_s_shangnianq;

        private string m_str_s_shujugd;

        private string m_str_s_wanchengltj;

        private string m_str_s_wanchenglxx;

        private string m_str_s_wanchenglys;

        private string m_str_s_wanchenglyz;

        /// <summary>
        ///     自增量
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     年
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     办事处方案
        /// </summary>
        public string S_BANSHICFN
        {
            get { return m_str_s_banshicfn; }
            set { m_str_s_banshicfn = value; }
        }

        /// <summary>
        ///     办事处确定方案
        /// </summary>
        public string S_BANSHICQDFN
        {
            get { return m_str_s_banshicqdfn; }
            set { m_str_s_banshicqdfn = value; }
        }

        /// <summary>
        ///     办事处下限
        /// </summary>
        public string S_BANSHICXX
        {
            get { return m_str_s_banshicxx; }
            set { m_str_s_banshicxx = value; }
        }

        /// <summary>
        ///     本部方案
        /// </summary>
        public string S_BENBUFN
        {
            get { return m_str_s_benbufn; }
            set { m_str_s_benbufn = value; }
        }

        /// <summary>
        ///     本部确定方案
        /// </summary>
        public string S_BENBUQDFN
        {
            get { return m_str_s_benbuqdfn; }
            set { m_str_s_benbuqdfn = value; }
        }

        /// <summary>
        ///     本部下限
        /// </summary>
        public string S_BENBUXX
        {
            get { return m_str_s_benbuxx; }
            set { m_str_s_benbuxx = value; }
        }

        /// <summary>
        ///     本年权
        /// </summary>
        public string S_BENNIANQ
        {
            get { return m_str_s_bennianq; }
            set { m_str_s_bennianq = value; }
        }

        /// <summary>
        ///     超计划条件低
        /// </summary>
        public string S_CHAOJIHTJD
        {
            get { return m_str_s_chaojihtjd; }
            set { m_str_s_chaojihtjd = value; }
        }

        /// <summary>
        ///     超计划条件高
        /// </summary>
        public string S_CHAOJIHTJG
        {
            get { return m_str_s_chaojihtjg; }
            set { m_str_s_chaojihtjg = value; }
        }

        /// <summary>
        ///     超计划条件中
        /// </summary>
        public string S_CHAOJIHTJZ
        {
            get { return m_str_s_chaojihtjz; }
            set { m_str_s_chaojihtjz = value; }
        }

        /// <summary>
        ///     超计划条件上限
        /// </summary>
        public string S_CHAOJIHTJSX
        {
            get { return m_str_s_chaojihtjsx; }
            set { m_str_s_chaojihtjsx = value; }
        }

        /// <summary>
        ///     超用率上限
        /// </summary>
        public string S_CHAOYONGLSX
        {
            get { return m_str_s_chaoyonglsx; }
            set { m_str_s_chaoyonglsx = value; }
        }

        /// <summary>
        ///     超用率条件
        /// </summary>
        public string S_CHAOYONGLTJ
        {
            get { return m_str_s_chaoyongltj; }
            set { m_str_s_chaoyongltj = value; }
        }

        /// <summary>
        ///     超用率月数
        /// </summary>
        public string S_CHAOYONGLYS
        {
            get { return m_str_s_chaoyonglys; }
            set { m_str_s_chaoyonglys = value; }
        }

        /// <summary>
        ///     超用率月止
        /// </summary>
        public string S_CHAOYONGLYZ
        {
            get { return m_str_s_chaoyonglyz; }
            set { m_str_s_chaoyonglyz = value; }
        }

        /// <summary>
        ///     当前步骤
        /// </summary>
        public string S_DAGNQIANBZ
        {
            get { return m_str_s_dagnqianbz; }
            set { m_str_s_dagnqianbz = value; }
        }

        /// <summary>
        ///     福利完成率
        /// </summary>
        public string S_FULIWCL
        {
            get { return m_str_s_fuliwcl; }
            set { m_str_s_fuliwcl = value; }
        }

        /// <summary>
        ///     福利完成率下限
        /// </summary>
        public string S_FULIWCLXX
        {
            get { return m_str_s_fuliwclxx; }
            set { m_str_s_fuliwclxx = value; }
        }

        /// <summary>
        ///     加价倍率
        /// </summary>
        public string S_JIAJIABL
        {
            get { return m_str_s_jiajiabl; }
            set { m_str_s_jiajiabl = value; }
        }

        /// <summary>
        ///     今年权
        /// </summary>
        public string S_JINNIANQ
        {
            get { return m_str_s_jinnianq; }
            set { m_str_s_jinnianq = value; }
        }

        /// <summary>
        ///     前年权
        /// </summary>
        public string S_QIANNIANQ
        {
            get { return m_str_s_qiannianq; }
            set { m_str_s_qiannianq = value; }
        }

        /// <summary>
        ///     去年权
        /// </summary>
        public string S_QUNIANQ
        {
            get { return m_str_s_qunianq; }
            set { m_str_s_qunianq = value; }
        }

        /// <summary>
        ///     上年权
        /// </summary>
        public string S_SHANGNIANQ
        {
            get { return m_str_s_shangnianq; }
            set { m_str_s_shangnianq = value; }
        }

        /// <summary>
        ///     数据改动
        /// </summary>
        public string S_SHUJUGD
        {
            get { return m_str_s_shujugd; }
            set { m_str_s_shujugd = value; }
        }

        /// <summary>
        ///     完成率条件
        /// </summary>
        public string S_WANCHENGLTJ
        {
            get { return m_str_s_wanchengltj; }
            set { m_str_s_wanchengltj = value; }
        }

        /// <summary>
        ///     完成率下限
        /// </summary>
        public string S_WANCHENGLXX
        {
            get { return m_str_s_wanchenglxx; }
            set { m_str_s_wanchenglxx = value; }
        }

        /// <summary>
        ///     完成率月数
        /// </summary>
        public string S_WANCHENGLYS
        {
            get { return m_str_s_wanchenglys; }
            set { m_str_s_wanchenglys = value; }
        }

        /// <summary>
        ///     完成率月止
        /// </summary>
        public string S_WANCHENGLYZ
        {
            get { return m_str_s_wanchenglyz; }
            set { m_str_s_wanchenglyz = value; }
        }

        /// <summary>
        ///     预测年
        /// </summary>
        public decimal? I_YUCEN
        {
            get { return m_dec_i_yucen; }
            set { m_dec_i_yucen = value; }
        }

        /// <summary>
        ///     预测月
        /// </summary>
        public decimal? I_YUCEY
        {
            get { return m_dec_i_yucey; }
            set { m_dec_i_yucey = value; }
        }

        /// <summary>
        ///     记录状态(0:正常;-1:逻辑删除)
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     操作时间
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }

        /// <summary>
        ///     备用1
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        ///     备用2
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        ///     备用3
        /// </summary>
        public decimal? I_BEIYONG3
        {
            get { return m_dec_i_beiyong3; }
            set { m_dec_i_beiyong3 = value; }
        }

        /// <summary>
        ///     备用4
        /// </summary>
        public decimal? I_BEIYONG4
        {
            get { return m_dec_i_beiyong4; }
            set { m_dec_i_beiyong4 = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_JH_YUBIANZJHPZProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_JH_YUBIANZJHPZProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_JH_YUBIANZJHPZ实体添加或者修改YS_JH_YUBIANZJHPZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_JH_YUBIANZJHPZ YS_JH_YUBIANZJHPZ, OracleTransaction Transaction)
        {
            if (YS_JH_YUBIANZJHPZ.ID == 0)
                InsertYS_JH_YUBIANZJHPZ(YS_JH_YUBIANZJHPZ, Transaction);
            else
                UpdateYS_JH_YUBIANZJHPZ(YS_JH_YUBIANZJHPZ, Transaction);
            return YS_JH_YUBIANZJHPZ.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_JH_YUBIANZJHPZ实体添加或修改YS_JH_YUBIANZJHPZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_JH_YUBIANZJHPZ YS_JH_YUBIANZJHPZ)
        {
            return InsertOrUpdate(YS_JH_YUBIANZJHPZ, null);
        }


        /// <summary>
        ///     根据YS_JH_YUBIANZJHPZ主键删除YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_JH_YUBIANZJHPZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_JH_YUBIANZJHPZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_JH_YUBIANZJHPZ主键删除YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_JH_YUBIANZJHPZ(decimal ID)
        {
            return DeleteYS_JH_YUBIANZJHPZ(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_JH_YUBIANZJHPZsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_JH_YUBIANZJHPZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_JH_YUBIANZJHPZsDynamic(string WhereClause)
        {
            return DeleteYS_JH_YUBIANZJHPZsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_JH_YUBIANZJHPZ主键选择YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_YUBIANZJHPZ信息</returns>
        public YS_JH_YUBIANZJHPZ SelectYS_JH_YUBIANZJHPZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YUBIANZJHPZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_JH_YUBIANZJHPZ = PopulateYS_JH_YUBIANZJHPZ(rd);
                rd.Close();
                return YS_JH_YUBIANZJHPZ;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_JH_YUBIANZJHPZ主键选择YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <returns>YS_JH_YUBIANZJHPZ信息</returns>
        public YS_JH_YUBIANZJHPZ SelectYS_JH_YUBIANZJHPZ(decimal ID)
        {
            return SelectYS_JH_YUBIANZJHPZ(ID, null);
        }

        /// <summary>
        ///     选择所有YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_JH_YUBIANZJHPZ信息</returns>
        public DataTable SelectYS_JH_YUBIANZJHPZsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YUBIANZJHPZsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <returns>所有YS_JH_YUBIANZJHPZ信息</returns>
        public DataTable SelectYS_JH_YUBIANZJHPZsAll()
        {
            return SelectYS_JH_YUBIANZJHPZsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_YUBIANZJHPZ信息</returns>
        public DataTable SelectYS_JH_YUBIANZJHPZsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YUBIANZJHPZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_JH_YUBIANZJHPZ信息</returns>
        public DataTable SelectYS_JH_YUBIANZJHPZsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_JH_YUBIANZJHPZsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_YUBIANZJHPZ信息</returns>
        public DataTable SelectYS_JH_YUBIANZJHPZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YUBIANZJHPZsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_JH_YUBIANZJHPZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_JH_YUBIANZJHPZ信息</returns>
        public DataTable SelectYS_JH_YUBIANZJHPZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_JH_YUBIANZJHPZsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_JH_YUBIANZJHPZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_JH_YUBIANZJHPZsDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_JH_YUBIANZJHPZDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_JH_YUBIANZJHPZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_JH_YUBIANZJHPZsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_JH_YUBIANZJHPZsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_JH_YUBIANZJHPZ(YS_JH_YUBIANZJHPZ YS_JH_YUBIANZJHPZ, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_JH_YUBIANZJHPZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_JH_YUBIANZJHPZ.I_Y;
            storedParams[1].Value = YS_JH_YUBIANZJHPZ.S_BANSHICFN;
            storedParams[2].Value = YS_JH_YUBIANZJHPZ.S_BANSHICQDFN;
            storedParams[3].Value = YS_JH_YUBIANZJHPZ.S_BANSHICXX;
            storedParams[4].Value = YS_JH_YUBIANZJHPZ.S_BENBUFN;
            storedParams[5].Value = YS_JH_YUBIANZJHPZ.S_BENBUQDFN;
            storedParams[6].Value = YS_JH_YUBIANZJHPZ.S_BENBUXX;
            storedParams[7].Value = YS_JH_YUBIANZJHPZ.S_BENNIANQ;
            storedParams[8].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJD;
            storedParams[9].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJG;
            storedParams[10].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJZ;
            storedParams[11].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJSX;
            storedParams[12].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLSX;
            storedParams[13].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLTJ;
            storedParams[14].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLYS;
            storedParams[15].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLYZ;
            storedParams[16].Value = YS_JH_YUBIANZJHPZ.S_DAGNQIANBZ;
            storedParams[17].Value = YS_JH_YUBIANZJHPZ.S_FULIWCL;
            storedParams[18].Value = YS_JH_YUBIANZJHPZ.S_FULIWCLXX;
            storedParams[19].Value = YS_JH_YUBIANZJHPZ.S_JIAJIABL;
            storedParams[20].Value = YS_JH_YUBIANZJHPZ.S_JINNIANQ;
            storedParams[21].Value = YS_JH_YUBIANZJHPZ.S_QIANNIANQ;
            storedParams[22].Value = YS_JH_YUBIANZJHPZ.S_QUNIANQ;
            storedParams[23].Value = YS_JH_YUBIANZJHPZ.S_SHANGNIANQ;
            storedParams[24].Value = YS_JH_YUBIANZJHPZ.S_SHUJUGD;
            storedParams[25].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLTJ;
            storedParams[26].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLXX;
            storedParams[27].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLYS;
            storedParams[28].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLYZ;
            storedParams[29].Value = YS_JH_YUBIANZJHPZ.I_YUCEN;
            storedParams[30].Value = YS_JH_YUBIANZJHPZ.I_YUCEY;
            storedParams[31].Value = YS_JH_YUBIANZJHPZ.I_JLZT;
            storedParams[32].Value = YS_JH_YUBIANZJHPZ.S_CAOZUOR;
            storedParams[33].Value = YS_JH_YUBIANZJHPZ.D_CAOZUOSJ;
            storedParams[34].Value = YS_JH_YUBIANZJHPZ.S_BEIYONG1;
            storedParams[35].Value = YS_JH_YUBIANZJHPZ.S_BEIYONG2;
            storedParams[36].Value = YS_JH_YUBIANZJHPZ.I_BEIYONG3;
            storedParams[37].Value = YS_JH_YUBIANZJHPZ.I_BEIYONG4;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_JH_YUBIANZJHPZ.ID = Convert.ToInt32(storedParams[38].Value);
            return result;
        }

        private bool UpdateYS_JH_YUBIANZJHPZ(YS_JH_YUBIANZJHPZ YS_JH_YUBIANZJHPZ, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_JH_YUBIANZJHPZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_JH_YUBIANZJHPZ.I_Y;
            storedParams[1].Value = YS_JH_YUBIANZJHPZ.S_BANSHICFN;
            storedParams[2].Value = YS_JH_YUBIANZJHPZ.S_BANSHICQDFN;
            storedParams[3].Value = YS_JH_YUBIANZJHPZ.S_BANSHICXX;
            storedParams[4].Value = YS_JH_YUBIANZJHPZ.S_BENBUFN;
            storedParams[5].Value = YS_JH_YUBIANZJHPZ.S_BENBUQDFN;
            storedParams[6].Value = YS_JH_YUBIANZJHPZ.S_BENBUXX;
            storedParams[7].Value = YS_JH_YUBIANZJHPZ.S_BENNIANQ;
            storedParams[8].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJD;
            storedParams[9].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJG;
            storedParams[10].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJZ;
            storedParams[11].Value = YS_JH_YUBIANZJHPZ.S_CHAOJIHTJSX;
            storedParams[12].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLSX;
            storedParams[13].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLTJ;
            storedParams[14].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLYS;
            storedParams[15].Value = YS_JH_YUBIANZJHPZ.S_CHAOYONGLYZ;
            storedParams[16].Value = YS_JH_YUBIANZJHPZ.S_DAGNQIANBZ;
            storedParams[17].Value = YS_JH_YUBIANZJHPZ.S_FULIWCL;
            storedParams[18].Value = YS_JH_YUBIANZJHPZ.S_FULIWCLXX;
            storedParams[19].Value = YS_JH_YUBIANZJHPZ.S_JIAJIABL;
            storedParams[20].Value = YS_JH_YUBIANZJHPZ.S_JINNIANQ;
            storedParams[21].Value = YS_JH_YUBIANZJHPZ.S_QIANNIANQ;
            storedParams[22].Value = YS_JH_YUBIANZJHPZ.S_QUNIANQ;
            storedParams[23].Value = YS_JH_YUBIANZJHPZ.S_SHANGNIANQ;
            storedParams[24].Value = YS_JH_YUBIANZJHPZ.S_SHUJUGD;
            storedParams[25].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLTJ;
            storedParams[26].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLXX;
            storedParams[27].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLYS;
            storedParams[28].Value = YS_JH_YUBIANZJHPZ.S_WANCHENGLYZ;
            storedParams[29].Value = YS_JH_YUBIANZJHPZ.I_YUCEN;
            storedParams[30].Value = YS_JH_YUBIANZJHPZ.I_YUCEY;
            storedParams[31].Value = YS_JH_YUBIANZJHPZ.I_JLZT;
            storedParams[32].Value = YS_JH_YUBIANZJHPZ.S_CAOZUOR;
            storedParams[33].Value = YS_JH_YUBIANZJHPZ.D_CAOZUOSJ;
            storedParams[34].Value = YS_JH_YUBIANZJHPZ.S_BEIYONG1;
            storedParams[35].Value = YS_JH_YUBIANZJHPZ.S_BEIYONG2;
            storedParams[36].Value = YS_JH_YUBIANZJHPZ.I_BEIYONG3;
            storedParams[37].Value = YS_JH_YUBIANZJHPZ.I_BEIYONG4;
            storedParams[38].Value = YS_JH_YUBIANZJHPZ.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_JH_YUBIANZJHPZ PopulateYS_JH_YUBIANZJHPZ(IDataReader dr)
        {
            var YS_JH_YUBIANZJHPZ = new YS_JH_YUBIANZJHPZ();
            YS_JH_YUBIANZJHPZ.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_JH_YUBIANZJHPZ.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            YS_JH_YUBIANZJHPZ.S_BANSHICFN = dr["S_BANSHICFN"] == DBNull.Value ? null : (string) dr["S_BANSHICFN"];
            YS_JH_YUBIANZJHPZ.S_BANSHICQDFN = dr["S_BANSHICQDFN"] == DBNull.Value ? null : (string) dr["S_BANSHICQDFN"];
            YS_JH_YUBIANZJHPZ.S_BANSHICXX = dr["S_BANSHICXX"] == DBNull.Value ? null : (string) dr["S_BANSHICXX"];
            YS_JH_YUBIANZJHPZ.S_BENBUFN = dr["S_BENBUFN"] == DBNull.Value ? null : (string) dr["S_BENBUFN"];
            YS_JH_YUBIANZJHPZ.S_BENBUQDFN = dr["S_BENBUQDFN"] == DBNull.Value ? null : (string) dr["S_BENBUQDFN"];
            YS_JH_YUBIANZJHPZ.S_BENBUXX = dr["S_BENBUXX"] == DBNull.Value ? null : (string) dr["S_BENBUXX"];
            YS_JH_YUBIANZJHPZ.S_BENNIANQ = dr["S_BENNIANQ"] == DBNull.Value ? null : (string) dr["S_BENNIANQ"];
            YS_JH_YUBIANZJHPZ.S_CHAOJIHTJD = dr["S_CHAOJIHTJD"] == DBNull.Value ? null : (string) dr["S_CHAOJIHTJD"];
            YS_JH_YUBIANZJHPZ.S_CHAOJIHTJG = dr["S_CHAOJIHTJG"] == DBNull.Value ? null : (string) dr["S_CHAOJIHTJG"];
            YS_JH_YUBIANZJHPZ.S_CHAOJIHTJZ = dr["S_CHAOJIHTJZ"] == DBNull.Value ? null : (string) dr["S_CHAOJIHTJZ"];
            YS_JH_YUBIANZJHPZ.S_CHAOJIHTJSX = dr["S_CHAOJIHTJSX"] == DBNull.Value ? null : (string) dr["S_CHAOJIHTJSX"];
            YS_JH_YUBIANZJHPZ.S_CHAOYONGLSX = dr["S_CHAOYONGLSX"] == DBNull.Value ? null : (string) dr["S_CHAOYONGLSX"];
            YS_JH_YUBIANZJHPZ.S_CHAOYONGLTJ = dr["S_CHAOYONGLTJ"] == DBNull.Value ? null : (string) dr["S_CHAOYONGLTJ"];
            YS_JH_YUBIANZJHPZ.S_CHAOYONGLYS = dr["S_CHAOYONGLYS"] == DBNull.Value ? null : (string) dr["S_CHAOYONGLYS"];
            YS_JH_YUBIANZJHPZ.S_CHAOYONGLYZ = dr["S_CHAOYONGLYZ"] == DBNull.Value ? null : (string) dr["S_CHAOYONGLYZ"];
            YS_JH_YUBIANZJHPZ.S_DAGNQIANBZ = dr["S_DAGNQIANBZ"] == DBNull.Value ? null : (string) dr["S_DAGNQIANBZ"];
            YS_JH_YUBIANZJHPZ.S_FULIWCL = dr["S_FULIWCL"] == DBNull.Value ? null : (string) dr["S_FULIWCL"];
            YS_JH_YUBIANZJHPZ.S_FULIWCLXX = dr["S_FULIWCLXX"] == DBNull.Value ? null : (string) dr["S_FULIWCLXX"];
            YS_JH_YUBIANZJHPZ.S_JIAJIABL = dr["S_JIAJIABL"] == DBNull.Value ? null : (string) dr["S_JIAJIABL"];
            YS_JH_YUBIANZJHPZ.S_JINNIANQ = dr["S_JINNIANQ"] == DBNull.Value ? null : (string) dr["S_JINNIANQ"];
            YS_JH_YUBIANZJHPZ.S_QIANNIANQ = dr["S_QIANNIANQ"] == DBNull.Value ? null : (string) dr["S_QIANNIANQ"];
            YS_JH_YUBIANZJHPZ.S_QUNIANQ = dr["S_QUNIANQ"] == DBNull.Value ? null : (string) dr["S_QUNIANQ"];
            YS_JH_YUBIANZJHPZ.S_SHANGNIANQ = dr["S_SHANGNIANQ"] == DBNull.Value ? null : (string) dr["S_SHANGNIANQ"];
            YS_JH_YUBIANZJHPZ.S_SHUJUGD = dr["S_SHUJUGD"] == DBNull.Value ? null : (string) dr["S_SHUJUGD"];
            YS_JH_YUBIANZJHPZ.S_WANCHENGLTJ = dr["S_WANCHENGLTJ"] == DBNull.Value ? null : (string) dr["S_WANCHENGLTJ"];
            YS_JH_YUBIANZJHPZ.S_WANCHENGLXX = dr["S_WANCHENGLXX"] == DBNull.Value ? null : (string) dr["S_WANCHENGLXX"];
            YS_JH_YUBIANZJHPZ.S_WANCHENGLYS = dr["S_WANCHENGLYS"] == DBNull.Value ? null : (string) dr["S_WANCHENGLYS"];
            YS_JH_YUBIANZJHPZ.S_WANCHENGLYZ = dr["S_WANCHENGLYZ"] == DBNull.Value ? null : (string) dr["S_WANCHENGLYZ"];
            YS_JH_YUBIANZJHPZ.I_YUCEN = dr["I_YUCEN"] == DBNull.Value ? null : (decimal?) dr["I_YUCEN"];
            YS_JH_YUBIANZJHPZ.I_YUCEY = dr["I_YUCEY"] == DBNull.Value ? null : (decimal?) dr["I_YUCEY"];
            YS_JH_YUBIANZJHPZ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_JH_YUBIANZJHPZ.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_JH_YUBIANZJHPZ.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            YS_JH_YUBIANZJHPZ.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_JH_YUBIANZJHPZ.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_JH_YUBIANZJHPZ.I_BEIYONG3 = dr["I_BEIYONG3"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG3"];
            YS_JH_YUBIANZJHPZ.I_BEIYONG4 = dr["I_BEIYONG4"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG4"];
            return YS_JH_YUBIANZJHPZ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion